<html>
<head>
    @include('v1.common.meta')
    <link rel="stylesheet" href="{{elixir('css/basicdata.css')}}">
</head>

<script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=Cmy7DxDCB6TLPj1r6ABIzpe1rPfx0IcQ"></script>
<body>
<div class="yjs-grid">
    <div class="yjs-grid-box">
        <div class="layui-tab">
            @if(Auth::check())
                <div class="layui-container">
                    @if($view==='addData')
                        {{--新增图文视图--}}
                        <div class="layui-row">
                            <div class="layui-col-md12">
                                <fieldset class="layui-elem-field">
                                    <legend>新增校区</legend>
                                    <div class="layui-field-box">
                                        <div class="layui-row hidden-tips">
                                            <div class="layui-col-md12">
                                                <blockquote class="layui-elem-quote">
                                                    温馨提示：新增数据时，存在"<i class="layui-icon">&#xe605;</i>"标识的表单项，建议您自主编辑维护；
                                                </blockquote>
                                            </div>
                                        </div>
                                        <div class="layui-form layui-form-pane" name="collegeForm"
                                             action="javascript:;" method="POST">
                                            <input type="hidden" name="viewType" value="{{$view}}">

                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label"><i
                                                                    class="layui-icon">&#xe605;</i>校区代码</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="code" required
                                                                   lay-verify="required"
                                                                   placeholder="请输入校区代码"
                                                                   class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label"><i
                                                                    class="layui-icon">&#xe605;</i>校区名称</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="name" required
                                                                   lay-verify="required"
                                                                   placeholder="请输入校区名称"
                                                                   class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label"><i
                                                                    class="layui-icon">&#xe605;</i>校区地址</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="address" required
                                                                   lay-verify="required"
                                                                   placeholder="请输入校区地址"
                                                                   class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">验证码</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" name="captcha" maxlength="4"
                                                                   lay-verify="required"
                                                                   placeholder="请输入图片验证码" autocomplete="off"
                                                                   class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md3">
                                                    <div class="layui-form-item">
                                                        <img class="getLVcode" src="{{ captcha_src('mini') }}"
                                                             width="70px"
                                                             height="34px" style="border: 1px solid green;"/>
                                                        <div class="layui-form-mid layui-word-aux">
                                                            点击图片刷新验证码
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md3">
                                                    {{--隐藏提交--}}
                                                    <button id="toolbarSubmit" type="submit" class="layui-btn"
                                                            lay-filter="toolbarEvent" lay-submit style="display: none;">
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </fieldset>
                            </div>
                        </div>

                    @elseif($view==='viewData')
                        <div class="layui-row">
                            <div class="layui-col-md12">
                                <fieldset class="layui-elem-field">
                                    <legend>查看【{{$itemData['name']}}】学校信息</legend>
                                    <div class="layui-field-box">
                                        <div class="layui-row hidden-tips">
                                            <div class="layui-col-md12">
                                                <blockquote class="layui-elem-quote">
                                                    温馨提示：查看数据时，所有表单项均不可修改。
                                                </blockquote>
                                            </div>
                                        </div>
                                        <div class="layui-form layui-form-pane">
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">校区代码</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="{{$itemData['code']}}" disabled
                                                                   class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label" >校区名称</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="{{$itemData['name']}}" disabled
                                                                   class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">校区地址</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="{{$itemData['address']}}"
                                                                   disabled class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>


                                            <div class="layui-row">
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">创建时间</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="{{$itemData['created_at']}}"
                                                                   disabled class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="layui-col-md6">
                                                    <div class="layui-form-item">
                                                        <label class="layui-form-label">更新时间</label>
                                                        <div class="layui-input-inline">
                                                            <input type="text" value="{{$itemData['updated_at']}}"
                                                                   disabled class="layui-input">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </fieldset>
                            </div>
                        </div>


                    @else
                        {{--视图类型不正确--}}
                        <div class="layui-row">
                            <div class="layui-col-md12">
                                <blockquote class="layui-elem-quote-error">
                                    友情提示：视图类型不正确，无法支持后续操作。
                                </blockquote>
                            </div>
                        </div>
                    @endif
                </div>
            @else
                <div class="layui-container">
                    <div class="layui-row">
                        <div class="layui-col-md12">
                            <blockquote class="layui-elem-quote-error">
                                友情提示：该功能只面向已成功登录系统，并具有相应权限的用户可用。
                            </blockquote>
                        </div>
                    </div>
                </div>
            @endif
        </div>
    </div>
</div>

@include('v1.common.js')

<script charset="utf-8" src="//map.qq.com/api/js?v=2.exp"></script>
<script src="{{elixir('js/collegesItem.js')}}"></script>
</body>
<script type="text/html">
    <input type="hidden" id="rspStatus" value="">
    <input type="hidden" id="rspMsg" value="">
</script>

</html>